package com.zsh.ssmspringboot1.controller;

import com.zsh.ssmspringboot1.model.User;
import com.zsh.ssmspringboot1.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/user")
public class UserController {
    @RequestMapping(value = "/login")
    public String login(){
        return "/behind/login";
    }
    @Autowired
    private UserService userService;
    @RequestMapping(value = "/login1")
    @ResponseBody
    public String login1(User user){
        User user1=userService.find(user);
        if(user1==null){
            return "error";
        }
        else{
            return "success";
        }
    }
    @RequestMapping(value = "/main")
    public String main(){
        return "/front/hospital_detail";
    }

}
